export const selectType = [
  {
    label: "全部",
    value: "",
  },
  {
    label: "信息资讯",
    value: "news",
  },
  {
    label: "服务指南",
    value: "guide",
  },
  {
    label: "培训信息",
    value: "train",
  },
  {
    label: "典型案例",
    value: "case",
  },
  {
    label: "促进指南",
    value: "promote_guide",
  },
  {
    label: "保护指南",
    value: "protect_guide",
  },

  {
    label: "裁决指南",
    value: "judge_guide",
  },
  {
    label: "公证指南",
    value: "notarization_guide",
  },
  {
    label: "仲裁指南",
    value: "arbitrate_guide",
  },
  {
    label: "促进政策",
    value: "promote_policy",
  },
  {
    label: "保护政策",
    value: "protect_policy",
  },
];

export const department_type = ["法院","检察院","司法局","公安","信用监管部门"]

export const rules = {
  title: [{ required: true, message: "请输入", trigger: "blur" }],
  type: [{ required: true, message: "请选择", trigger: "blur" }],
};

export const typeMap = (type: string) => {
  return selectType.filter((item) => item.value === type)[0]?.label || "-";
};

const statusMap = [
  {
    label: 0,
    title: "已撤销",
    type: "danger",
  },
  {
    label: 1,
    title: "已发布",
    type: "success",
  },
];
export const handleStatusMap = (label) => {
  return statusMap.filter((item) => item.label === label)[0];
};
